package makabakaquestionnaire.zutsoftware.service.impl;

import cn.hutool.core.util.ObjectUtil;
import makabakaquestionnaire.zutsoftware.entity.ProjectTheme;
import makabakaquestionnaire.zutsoftware.mapper.ProjectThemeMapper;
import makabakaquestionnaire.zutsoftware.service.ProjectThemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProjectThemeServiceImpl implements ProjectThemeService {
    ProjectThemeMapper projectThemeMapper;
    @Autowired
    public void setProjectThemeMapper(ProjectThemeMapper projectThemeMapper) {
        this.projectThemeMapper = projectThemeMapper;
    }

    @Override
    public ProjectTheme queryProjectThemeByProKey(String proKey) {
        return projectThemeMapper.queryProjectThemeByProKey(proKey);
    }

    @Override
    public Boolean saveProjectTheme(ProjectTheme projectTheme) {
        int n=projectThemeMapper.saveProjectTheme(projectTheme);
        if (n!=1){
            return false;
        }else {
            return true;
        }
    }

    @Override
    public Boolean deleteProjectTheme(Long id) {
        return null;
    }

    @Override
    public Boolean updateProjectTheme(ProjectTheme projectTheme) {
        int n=projectThemeMapper.updateProjectTheme(projectTheme);
        if (n!=1){
            return false;
        }else {
            return true;
        }
    }
}
